import axios from '@/utils/request'
/**
 * 获取组织架构的数据
 */
export function getDepartments() {
  return axios({
    url: '/company/department'
  })
}

/**
 * 删除组织结构部门
 */
export function delDepartments(id) {
  return axios({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
/**
 * 新增部门
 */
export function addDepartments(data) {
  return axios({
    url: '/company/department',
    method: 'post',
    data
  })
}

/**
 * 获取部门详情
 */
export const getDepartDetail = (id) => axios({
  url: `/company/department/${id}`
})

// /***
//  * 编辑部门
//  * /
export const updataDepartments = (data) => axios({
  url: `/company/department/${data.id}`,
  method: 'put',
  data
})
